import { axios } from "../../utils/request";

const api = {
  page: "/crm/activity/page",   
  save: "/crm/activity/save",
  detail:"/crm/activity/detail",     // 详情
  batchDelete: "/crm/activity/batchDelete",
  checkActivityTitle: "/crm/activity/checkActivityTitle",
  listCompanyActivities:"/crm/activity/listCompanyActivities",  //市场活动下拉数据
};


/**
 * 列表
 */
export function pageList(parameter) {
    return axios({
      url: api.page,
      method: "get",
      params: parameter
    });
  }

/**
 * 保存
 */
export function save(parameter) {
  return axios({
    url: api.save,
    method: "post",
    data: parameter
  });
}


/**
 * 删除
 */
export function batchDelete(data) {
  return axios({
    url: api.batchDelete,
    method: "post",
    data: data
  });
}

/**
 * 详情
 */
export function detail(data) {
  return axios({
    url: api.detail,
    method: "get",
    params: data
  });
}

/**
 * 检测 活动名称 是否存在
 */
export function checkActivityTitle(parameter) {
  return axios({
    url: api.checkActivityTitle,
    method: "get",
    params: parameter
  });
}
/**
 * 获取公司市场活动下拉数据
 * @param {*} parameter 
 */
export function listCompanyActivities(parameter) {
  return axios({
    url: api.listCompanyActivities,
    method: "get",
    params: parameter
  });
}

